/*    */ package com.zimbra.cs.server;
/*    */ 
/*    */ import java.util.concurrent.ThreadFactory;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TcpThreadFactory
/*    */   implements ThreadFactory
/*    */ {
/* 23 */   private int count = 0;
/*    */   private final String prefix;
/*    */   private final boolean isDaemon;
/*    */   private final int priority;
/*    */   
/*    */   public TcpThreadFactory(String prefix, boolean isDaemon) {
/* 29 */     this(prefix, isDaemon, 5);
/*    */   }
/*    */   
/*    */   public TcpThreadFactory(String prefix, boolean isDaemon, int priority) {
/* 33 */     this.prefix = prefix;
/* 34 */     this.isDaemon = isDaemon;
/* 35 */     this.priority = priority;
/*    */   }
/*    */   
/*    */   public Thread newThread(Runnable runnable)
/*    */   {
/*    */     int n;
/* 41 */     synchronized (this) {
/* 42 */       n = ++this.count;
/*    */     }
/* 44 */     StringBuffer sb = new StringBuffer(this.prefix);
/* 45 */     sb.append('-').append(n);
/* 46 */     Thread t = new Thread(runnable, sb.toString());
/* 47 */     t.setDaemon(this.isDaemon);
/* 48 */     t.setPriority(this.priority);
/* 49 */     return t;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/server/TcpThreadFactory.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */